package ynu.sxp.demoapp.product.entity;

import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import ynu.sxp.demoapp.common.BaseEntity;

import java.util.ArrayList;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Getter
@Setter
@Table(name = "product")
public class ProductEntity extends BaseEntity {
    @Column(nullable = false)
    private String title;
    private String type;
    private String description;
    private double price;
    private String image;

    @ManyToMany(fetch = FetchType.EAGER)
    List<TagEntity> tags = new ArrayList<>();

}
